class Solution:
    def permuteUnique(self, nums):
        len_nums, res = len(nums), []
        if len_nums <= 1:
            return [nums]
        else:
            for i in nums:
                mid_list = nums[:]
                mid_list.remove(i)
                mid_res = self.permuteUnique(mid_list)
                for lists in mid_res:
                    lists.append(i)
                    if lists not in res:
                        res.append(lists)
        return res



a = Solution()
print(a.permute([1, 1]))